Page({
  data: {
    tripname:'',
    fromdate: '',
    todate:'',
    showfrom: false,
    showto:false,
    current:"homepage"
  },
  reset:function(){
    this.setData({
      todate:'',
      fromdate:'',
      tripname:''
    })
  },
  handleChange ({ detail }) {
    if(detail.key!="travel"){
      wx.redirectTo({
      url: '../'+detail.key+'/'+detail.key,
    })
    }
},
  showfrom: function () {
    this.setData({
      showfrom: true
    })
  },
  showto: function () {
    this.setData({
      showto: true
    })
  },
  //选择日期
  _doChangefrom: function (e) {
    console.log(e.detail)
    this.setData({
      fromdate: e.detail.date
    })
  },
  _doChangeto: function (e) {
    console.log(e.detail)
    this.setData({
      todate: e.detail.date
    })
  },
  //关闭选择器
  _doClose: function () {
    this.setData({
      showfrom: false,
      showto:false
    })
  }
})